<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script type="text/javascript" src="../../yui-base.js"></script>
<script type="text/javascript" src="../../tbra-debug.js?k1=v1&k2=v2&t=20071230.js"></script>
<script type="text/javascript" src="fake.js?name=tbra&_a=23.js"></script>
</head>

<div class="demoDiv">
	<ul id="demoUl">
		<li>test1</li>
		<li id="demoLi">test2</li>
		<li>test3</li>
	</ul>
</div>

<hr />

<h2>TB.dom.insertAfter</h2> 
<script type="text/javascript">
var testLi = document.createElement('li');
testLi.innerHTML = 'test1.5';
TB.dom.insertAfter(testLi, 'demoLi')
document.write(TB.dom.getNextSibling('demoLi').innerHTML);		
//@TODO
</script>

<h2>TB.dom.getAncestorByTagName</h2> 
<script type="text/javascript">
document.write(TB.dom.getAncestorByTagName('demoLi', 'div').className);		
//@TODO
</script>

<h2>TB.dom.getAncestorByClassName</h2> 
<script type="text/javascript">
document.write(TB.dom.getAncestorByClassName('demoLi', 'demoDiv').tagName);		
//@TODO
</script>


<h2>TB.dom.getNextSibling</h2> 
<script type="text/javascript">

document.write(TB.dom.getNextSibling('demoLi').innerHTML);		
//@TODO

</script>

<h2>TB.dom.getPreviousSibling</h2> 
<script type="text/javascript">

document.write(TB.dom.getPreviousSibling('demoLi').innerHTML);		
//@TODO

</script>


<h2>TB.dom.addCSS</h2> 

<button onclick="TB.dom.addCSS('.demoDiv {color:red;}')">TB.dom.addCSS('.demoDiv {color:red;}')</button>

<br />

<div id="demo:holder""></div>
<script type="text/javascript">
	var iframe = null;
	try {
		iframe = document.createElement('<iframe name="tbra:dom-test">');
	} catch (e) {
		iframe = document.createElement('iframe');
		iframe.name = 'tbra:dom-test';
	}
	$('demo:holder').appendChild(iframe);
	var button = document.createElement('button');
	button.onclick = function() {
		TB.dom.addCSS('body {color:red;}', TB.dom.getIframeDocument(iframe));
	}
	button.innerHTML = 'TB.dom.addCSS(\'.demoDiv {color:red;}\', TB.dom.getIframeDocument(iframe))';
	$('demo:holder').appendChild(button);
	window.frames['tbra:dom-test'].document.write('<html><head></head><body>test TB.dom.addCSS</body></html>');
	
</script>

<h2>TB.dom.getScriptParams</h2> 

<br />

<script type="text/javascript">
	document.write(YAHOO.lang.dump(TB.dom.getScriptParams('tbra-debug.js')) + '<br />');
	document.write(YAHOO.lang.dump(TB.dom.getScriptParams(/fake(\.source)?\.js/)) + '<br />');
</script>

<body>
</body>
</html>
